import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta:{
      isShow:true,
    }
  },
  {
    path: '/topic',
    name: 'Topic',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/topic/index.vue'),
    meta:{
      isShow:true,
    }
  },
  {
    path: '/category',
    name: 'Category',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/category/index.vue'),
    meta:{
      isShow:true,
    }
  },
  {
    path: '/cart',
    name: 'Cart',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/cart/index.vue'),
    meta:{
      isShow:true,
    }
  },
  {
    path: '/my',
    name: 'My',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/my/index.vue'),
    meta:{
      isShow:true,
    }
  },
  {
    path: '/home/city',
    name: 'city',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/home/city.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path: '/home/search',
    name: 'search',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/home/search.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/category/:ids',
    name:'categorylist',
    component:()=> import('../views/category/list/index.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/home/business',
    name:'business',
    component:()=> import('../views/home/business.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/home/businessOne/:ids',
    name:'businesslist',
    component:()=> import('../views/home/business1.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/home/new',
    name:'new',
    component:()=> import('../views/home/new.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/home/detail/:ids',
    name:'detaillist',
    component:()=> import('../views/home/detail.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/home/collect',
    name:'addcollect',
    component:()=> import('../views/home/collect.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/my/address',
    name:'address',
    component:()=> import('../views/my/address/index.vue'),
    meta:{
      isShow:false,
    }
  },
  {
    path:'/my/address/1',
    name:'new',
    component:()=>import('../views/my/address/new.vue'),
    meta:{
      isShow:false
    }
  },
  {
    path:'/my/address/2',
    name:'edit',
    component:()=>import('../views/my/address/edit.vue'),
    meta:{
      isShow:false
    }
  }
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
